package com.example.treasure_back.controller;

import com.example.treasure_back.entity.MsgEntity;
import com.example.treasure_back.model.GarbageModel;
import com.example.treasure_back.service.GarbageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/treasure/garbage")
public class GarbageController {

    @Autowired
    private GarbageService garbageService;

    @RequestMapping("/getGarbageById/{id}")
    public MsgEntity getGarbageById(@PathVariable Integer id){
        GarbageModel garbage = garbageService.getGarbageById(id);
        return new MsgEntity("SUCCESS","200",garbage);
    }
}
